-
Notifications
You must be signed in to change notification settings - Fork 229
Implement _so_ many things, upgrade all deps. #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/server/upgrade/hyper.rs
Outdated
| http.0.try_clone().ok().map(Box::new) | ||
| } else if let Some(ssl) = self.downcast_ref::<SslStream<HttpStream>>() { | ||
| unimplemented!(); | ||
| } else if let Some(ssl) = self.downcast_ref::<HttpsStream<SslStream<HttpStream>>>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There must be a better way!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah this doesn't seem ideal really - I can't think of a better way right now though, haha
BREAKING CHANGE: This breaks a lot of the Client and Server APIs. Check the documentation for how Handlers can be used for asynchronous events.
|
@illegalprime Thanks for this! These changes seem good to me, I can't really see anything that I think should be done differently. Awesome work! |
|
@cyderize so what needs to happen to land this? Servo would really like to use this. |
|
I quite like this changes. |
|
Any update on this? |
|
@beatgammit, Note: forked crate |
|
@vi @beatgammit yeah I've had quite a year of failures on my part 😢 I am refocusing and would love more help! I guess we should make a list of TODOs like in #27 |
ae6141b to
0d544ed
Compare
4b034f8 to
8a4c08b
Compare
efbdf92 to
8d74d83
Compare
8dead61 to
9ef62af
Compare
Changes the way clients are created slightly:
- (slightly, ostensibly) better performance when one knows if they want
a secure connection or not. This means no match statement redirecting
calls to their respective SSL or TCP stream.
These calls have been named:
- `connect` for insecure connections
- `connect_secure` for secure connections
- If one does not know how which connection it wants it can take the
(not verified by testing) performance hit of putting the underlying
stream on the heap behind a `Box`. This can be done with:
- `connect_agnostic`
All calls currently take the custom ToWebSocketUrlComponents but that
should be changed to a `Url` (probably from rust-url).
Both streams and request/stream pairs can be made into a WsUpgrade struct. also AsTcpStream streams have a method to access the inner tcp stream. Things left: - Finish WsUpgrade struct: add methods and ability to accept or reject connections. - Implement IntoWs for a hyper serverside request.
The last bit is to extract the NetworkStream from a hyper server-side request and save that as a Stream, then turn it into an Incoming<(..)> and validate the request. Implementing Stream for a NetworkStream is proving complicated, since because now there is conflicting implementations for many structs implementing NetworkStream.
…re all AsTcpStreams implement Stream
This was initially very hard because one cannot clone unsized types and put them on the stack. I was about to revert to WebSocketStream style enum-variant-per-sized-type style but I managed to live another day without all those match blocks.
The validation is done, now the only work is to extract the underlying stream.
this is possible with the help of hyperium/hyper#1107
This code change is
not yet complete, and passes no testscomplete, needs docs.Summary of changes:
a lot, so coming soon